Skip to content

parity: add LCOW document permutation tests#2631

Open
shreyanshjain7174 wants to merge 1 commit intomicrosoft:mainfrom
shreyanshjain7174:parity/lcow-permutations
Open

parity: add LCOW document permutation tests#2631
shreyanshjain7174 wants to merge 1 commit intomicrosoft:mainfrom
shreyanshjain7174:parity/lcow-permutations

Conversation

@shreyanshjain7174
Copy link
Contributor

@shreyanshjain7174 shreyanshjain7174 commented Mar 16, 2026

This PR extends the LCOW parity test infrastructure from #2629 with permutation tests that exercise annotation and option combinations triggering different document construction branches in the legacy and v2 pipelines.

Note: This PR is stacked on #2629. The diff will clean up once that PR merges.

Changes

Permutation tests (TestLCOWDocumentParityPermutations)

19 test cases covering:

  • CPU partial combinations — count-only, limit-only, weight-only
  • Memory — overcommit disabled, cold discard hint
  • Boot mode — kernel direct + VHD rootfs
  • Feature flags — scratch encryption + disabled writable shares, writable overlay dirs
  • Device interactions — VPMem disabled (triggers 4 SCSI controllers)
  • Cross-group — physically backed + VPMem disabled + scratch encryption, full CPU + memory + MMIO + QoS + cold discard + VHD boot
  • Shim option overrides — annotation CPU/memory overriding shim option values
  • Kernel args — VPCIEnabled + custom boot options, time sync + process dump + writable overlay, initrd boot whitespace quirk

Gap tests

3 tests documenting known v2 builder differences using inverted assertions (they expect a diff and only fail if the documents unexpectedly match):

Gap Legacy V2
No CPUGroupID set CpuGroup = nil CpuGroup = &{Id:""}
No StorageQoS set StorageQoS = nil StorageQoS = &{}
Initrd boot VPMem controller allocated VirtualPMem = nil

These are tracked for fixes in the v2 builder (see #2630).

Kernel cmdline whitespace handling

Added normalizeKernelCmdLine and isOnlyKernelCmdLineWhitespaceDiff helpers. The legacy builder produces a leading space in kernel command lines for initrd+KernelDirect boot that the v2 builder correctly omits. Since HCS trims whitespace, this difference is harmless and we warn instead of failing.

Depends on

Restructure parity test framework and add permutation-based tests for
LCOW HCS document creation comparing legacy and v2 builder outputs.

Signed-off-by: Shreyansh Sancheti <shreyanshjain7174@gmail.com>
Signed-off-by: Shreyansh Sancheti <shsancheti@microsoft.com>
@shreyanshjain7174 shreyanshjain7174 force-pushed the parity/lcow-permutations branch from 82096da to f71836c Compare March 20, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant